package com.ruoyi.module.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import com.ruoyi.module.service.IDemoService;
/**
 * 示例模块Controller
 * 
 * @author ruoyi
 */
@RestController
@RequestMapping("/module/demo")
public class DemoController extends BaseController
{
    /**
     * 测试接口
     * 权限注解：@PreAuthorize("@ss.hasPermi('module:demo:test')")
     * 权限字符串 'module:demo:test' 需要在数据库 sys_menu 表中定义
     */
    @Autowired
    private IDemoService demoService;


    @GetMapping("/test")
    
    @PreAuthorize("@ss.hasPermi('module:demo:test')")
    public AjaxResult test()
    {
        return AjaxResult.success(demoService.getDemoData());
    }
}

